1. Field of the Invention
The present invention generally relates to a memory, and more particularly to a memory and a method for managing data.
2. Description of the Related Art
Generally, a primary memory, such as a Random Access Memory (RAM), has advantages in that it is faster than a secondary memory, for example, a hard disk or a flash memory, and is also easier to use. However, the primary memory is more expensive than the secondary memory based on the same memory capacity.
Especially, in an embedded system, such as a mobile terminal, the larger the capacity of the primary memory is, the higher the unit price of component becomes, so price competitiveness of the mobile terminal is weak. For this reason, mobile terminal manufacturers try to manufacture a primary memory having a capacity as small as possible.
In order to solve the shortage of the capacity of the primary memory, a virtual memory scheme using swapping is mainly employed. A virtual memory scheme sets a virtual memory region in the secondary memory. According to the virtual memory scheme, data moves to the virtual memory region, and only data necessary for actual performance moves to the primary memory from the virtual memory region to be processed.
However, in the aforementioned virtual memory scheme, a period of time is spent in moving data between the primary memory and the second memory. Accordingly, frequent movement of data between the primary memory and the secondary memory causes problems of lowering data processing speed.